<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>8-选择器拓展</title>
    <style>
        body a:nth-of-type(1):link{
            color: red;
        }
        /* a链接点击一下 */
        body a:nth-of-type(2):visited{
            color: blue;
        }
        body a:nth-of-type(3):hover{
            color: orange;
        }
        /* 鼠标按下 */
        body a:nth-of-type(4):active{
            color: pink;
        }
        /* 获取焦点时，改变input的背景色 */
        input:focus{
            background: red;
        }
        /* 属性选择器 */
        input[type="password"]{
            width: 100px;
            height: 30px;
            border: 2px solid red;
        }
    </style>
</head>
<body>
    <a href="">西安</a>
    <a href="">北京</a>
    <a href="">上海</a>
    <a href="">成都</a>
    <hr>    
    <input type="text" placeholder="请输入密码...">
    <input type="password" placeholder="请输入密码...">
</body>
</html>